package com.artogrid.framework.roue.datasource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

import com.artogrid.framework.holder.DynamicDataSourceHolder;

public class CustomerRoutingDataSource extends AbstractRoutingDataSource{
	protected final Logger logger = LoggerFactory.getLogger(CustomerRoutingDataSource.class);
	@Override
	protected Object determineCurrentLookupKey() {
		logger.info("启动的是【"+DynamicDataSourceHolder.getDataSourceType()+ "】数据源");
		return DynamicDataSourceHolder.getDataSourceType();
	}

}
